<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .b1 {
            width: 500px;
            height: 500px;
            border: 1px solid green;
        }

        .b1 p {
            width: 100px;
            height: 100px;
            background: blue;
            transition: 2s;
        }

        .b1:hover p {
            /* rotate 旋转  */
            transform: rotate(-360deg);
        }

        .b2 {
            width: 500px;
            height: 500px;
            border: 1px solid green;
        }

        .b2 p {
            width: 100px;
            height: 100px;
            background: blue;
            transition: 2s;
            /* transform-origin 设置旋转的中心点坐标 */
            transform-origin: 250px 250px;
        }

        .b2:hover p {
            transform: rotate(-360deg);
        }
    </style>
</head>

<body>
    <div class="b1">
        <p>旋转</p>
    </div>
    <div class="b2">
        <p>设置中心点</p>
    </div>
</body>

</html>